/**
 * 菜单数据配置（主菜单 + 子菜单）
 */
export const menuData = [
  {
    id: 1,
    name: '公共基础模块',
    icon: 'el-icon-document',
    children: [
      { id: 101, name: '个人信息管理', parentId: 1 },
      { id: 102, name: '通知偏好设置', parentId: 1 },
      { id: 103, name: '历史记录查看', parentId: 1 },
      { id: 104, name: '系统主题选择', parentId: 1 }
    ]
  },
  {
    id: 2,
    name: '突发事件查询',
    icon: 'el-icon-document',
    children: [
      { id: 201, name: '查询结果分享', parentId: 2 }
    ]
  },
  {
    id: 3,
    name: '现场调查管理',
    icon: 'el-icon-document',
    children: [
      { id: 301, name: '调查报告保存与分享', parentId: 3 },
      { id: 302, name: '调查报告导出', parentId: 3 },
      { id: 303, name: '调查内容查询与检索', parentId: 3 }
    ]
  },
  {
    id: 4,
    name: '系统消息管理',
    icon: 'el-icon-document',
    children: [
      { id: 401, name: '系统消息发送', parentId: 4 }
    ]
  },
  {
    id: 5,
    name: '个人消息管理',
    icon: 'el-icon-document',
    children: [
      { id: 501, name: '消息回复与反馈', parentId: 5 },
      { id: 502, name: '消息通知设置', parentId: 5 }
    ]
  },
  {
    id: 6,
    name: '应急知识手册',
    icon: 'el-icon-document',
    children: [
      { id: 601, name: '文档下载查看', parentId: 6 }
    ]
  },
  {
    id: 7,
    name: ' 值班信息',
    icon: 'el-icon-document',
    children: [
      { id: 701, name: '值班信息导出', parentId: 7 }
    ]
  },
  {
    id: 8,
    name: ' 事件续报',
    icon: 'el-icon-document',
    children: [
      { id: 801, name: '事件续报录入', parentId: 8 },
      { id: 802, name: '事件描述及措施记录', parentId: 8 },
      { id: 803, name: '处理情况反馈', parentId: 8 },
      { id: 804, name: '报告人信息记录', parentId: 8 },
      { id: 805, name: '续报信息校验', parentId: 8 },
      { id: 806, name: '续报信息存储', parentId: 8 },
      { id: 807, name: '续报信息查询与导出', parentId: 8 },
      { id: 808, name: '事件状态跟踪', parentId: 8 },
    ]
  }
];

/**
 * 根据子菜单ID获取完整路径信息
 */
export function getMenuPath(subMenuId) {
  for (const menu of menuData) {
    const subMenu = menu.children.find(child => child.id === subMenuId);
    if (subMenu) {
      return {
        parentMenu: menu,
        subMenu: subMenu
      };
    }
  }
  return null;
}
